<?php
/**
 * Created by JetBrains PhpStorm.
 * Author: yuanji <fenglangyj@139.com>
 * DateTime: 12-11-2 下午10:08
 * Copyright (c) 2012 http://www.magentoui.com All rights reserved.
 * Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
 * test.php这个类测试用
 */
class testAction extends Action {
	public function index(){
        $a = $this->genTree(array('1','2','3'));
        print_r($a);
    }
    function genTree($items) {
        $tree = array(); //格式化好的树
        foreach ($items as $key => $item)
            if (isset($items[$key]))
                $items[$key] = &$items[$item];
            else
                $tree[] = &$items[$key];
        return $tree;
    }
}
